import axios from "axios";
import showMessage from "@/utils/showMessage";

const ins = axios.create()
ins.interceptors.response.use(function (res) {
    if (res.data.code !== 0) {
        showMessage({
            content: res.data.msg,
            type: "error",
            duration: 2000
        })
        res.data.data = null
        return res.data
    }
    return res.data
})

export default ins
